# File: Token.rb
# Authors: Jenny Valdez, Jesus Martinez
#     In this file it is defined the class that contains the main attributes
#     of a Vectorinox's token.


# Class that contains the main attributes of a token.
class Token
    attr_reader :col, :line, :value, :type

    # Creates a new empty token with location in text given by (line, col)
    def initialize(line, col)
        @line = line
        @col = col
        @val = nil
        @type = "Token"
    end

    # Method that prints the type, value (if exists), line and column
    # where a token was found
    def to_s
        return "#{@type} #{@value if @value} (Linea #{@line}, Columna #{@col})"
    end
end